package com.teach.service.photo;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import com.github.pagehelper.PageInfo;
import com.teach.dto.LoginUser;
import com.teach.dto.PhotoFormDTO;
import com.teach.dto.PhotoPicSearch;
import com.teach.dto.PhotoPopularAuthorDTO;
import com.teach.entity.PhotoPic;

public interface PhotoPicService {

	 	int deleteByPrimaryKey(Long photoPicId);

	    int insert(PhotoPic record);
	    /*
	     * 如果使用inserSelective就会只给有值的字段赋值（会对传进来的值做非空判断）
	     */
	    int insertSelective(LoginUser user, PhotoFormDTO form,MultipartFile img);

	    PhotoPic selectByPrimaryKey(Long photoPicId);

	    /*
	     * 会对字段进行判断再更新(如果为Null就忽略更新)，如果你只想更新某一字段，可以用这个方法。
	     */
	    int updateByPrimaryKeySelective(PhotoPic record);

	    /*
	     * 更新所有字段。
	     */
	    int updateByPrimaryKey(PhotoPic record);
	    
	    List<PhotoPic> selectAll(int index,int len);
	    
	    /*
	     * 查询点赞数从高到低的十条。
	     */
	    List<PhotoPic> selectGreatDESC();
	    
	    /*
	     * 查询图片的详细信息
	     */
	    List<PhotoPic> selectPicDetails(String title,String writerId,Long picClassId);
	    
	    List<PhotoPic> selectByWriterId(String photoWriterId);
	    
	    Long selectPicTitle(String photoPicTitle);
	    
	    PhotoPopularAuthorDTO  selectPopularAuthor(String photoReleaseTime,String userName);
	    
	    Integer selectWorksCount(String photoReleaseTime,String userName);
	    
	    PhotoPic selectPicDetailsDESC(String title,String writerId,Long picClassId);
	    
	    List<PhotoPic> selectType(Long picClassId);
	    
	    /**
	     * 分页、搜索
	     * @param search
	     * @return
	     */
	    PageInfo<PhotoPic> pageSearch(PhotoPicSearch search);
	    
	    PhotoPopularAuthorDTO selectAuthorInfo(String userName);
}
